export default {
    /**
     * 数据表格加载
     * @param {*VUE} parent 
     * @param {number} page 
     */
    tableLoad(parent,page){
      // 页面加载成功
      // parent.$c.value('page_load', true);
      parent.loading = true;
      page = page? page:1;   
      parent.$c.PigeonsGet('finance/account/{user}/sets', 
        {page: page, rand: Math.random()}, 
        (result)=>{
          // console.log(result);
          parent.tableData = result.data;
          parent.tb_pagerMk = true;
          parent.tb_pager = {count:result.count, page:result.page};
        },
        (error, httpMK)=>{
          // console.log(error);
          parent.$message({message: error, type: 'warning'});
        },
        () =>{
          parent.loading = false;
          parent.fullscreenLoading = false;
        }
      );
    },
    getData(parent, page){
      var url = parent.$c.pigeons();
    },
    /**
     * 编辑页面控件选项自动加载
     * @param {Vue} parent 
     */
    editCtrlOpt(parent){      
      // 财务甲乙
      parent.$c.PigeonsGet('finance/affair/option?user={user}',
        {type: 'MASTER'},
        (result)=>{
          parent.master_options = result.data;
        },
        (error, httpMK)=>{},
        ()=>{}
      );
      
      // 科目
      parent.$c.PigeonsGet('finance/subject/option?user={user}',
        null,
        (result)=>{
          parent.subject_options = result.data;
        },
        (error, httpMK)=>{
        },
        ()=>{}
      );

      // 事务
      // console.log(parent.$router);      
    },
    // 单记录加
    loadSinglerList(parent, param){
      parent.$c.PigeonsGet('finance/account/data/'+param.no+'?user={user}',
        null,
        (dd)=>{
          parent.ruleForm = dd;
        },
        (error, httpMK)=>{
        },
        ()=>{}
      );
    }
}